import random
i = 0
j = 0
k = 1000
while k > 100:
    guess = input("猜大还是猜小：")
    a = random.randint(1, 6)
    b = random.randint(1, 6)
    c = random.randint(1, 6)
    num = int(a) + int(b) + int(c)
    if( guess == "exit"):
        print("退出游戏")
        break
    else:
        i += 1
        if ( 3 < num <= 10 ):
            print(a,b,c,num,"小")
            if(guess == "小"):
                print("恭喜你猜对了，游戏胜利")
                j += 1
                k += 100
            else:
                print("很遗憾你猜错了，游戏失败")
                k -= 100
        else:
            print(a, b, c, num, "大")
            if (guess == "大"):
                print("恭喜你猜对了，游戏胜利")
                j += 1
                k += 100
            else:
                print("很遗憾你猜错了，游戏失败")
                k -= 100
    print(f"你一共玩了{i}次,胜率为{j/i},你的金豆剩余{k}个")
else:
    print("你的金豆数量小于100,无法继续游戏,请充值")
